import axios from 'axios'
const instance = axios.create({
    baseURL: 'http://localhost:3002/',
    timeout: 10000,
    headers: { 'content-type': 'application/json' }
})

instance.interceptors.request.use(
    function(config) {
        return config
    },
    function(error) {
        return Promise.reject(error)
    }
)

// Add a response interceptor
instance.interceptors.response.use(
    function(response) {
        return response.data
    },
    function(error) {
        return Promise.reject(error)
    }
)

export default instance
